#灰度直方图测试
import cv2
import custom
from matplotlib import pyplot as plt

img = cv2.imread("pic/ll.png", 0)
# custom.showPicture("original", img) #输出原始图像
# hist = cv2.calcHist([img],[0],None,[256],[0,256])  #画出原始图像直方图
# plt.plot(hist)
srv1=cv2.equalizeHist(img)
# custom.showPicture("equalizeHist", srv1)  #输出均衡化后的图像
hist1 = cv2.calcHist([srv1],[0],None,[256],[0,256])  #画出均衡化后的直方图
plt.plot(hist1)
plt.show()
cv2.waitKey(0)